<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="shortcut icon" href="../../../docs/image/image2D.png">
    <script src="../../../build/image2D.js"></script>
    <title>image2D - 用例测试 - 线性渐变</title>
</head>

<body>
    <script>

        // 准备画布
        var canvas = $$('<canvas>非常抱歉，您的浏览器不支持canvas!</canvas>').attr({
            "width": 700,
            "height": 700
        }).appendTo('body');

        // 获取并配置画笔
        var painter = canvas.painter();

        /**
         * 测试开始
         * ----------------------------
         */

        var linearGradient = painter.createLinearGradient(0, 0, 700, 700);
        linearGradient.addColorStop(0, '#f00');
        linearGradient.addColorStop(1, '#00f');

        painter.config({
            "fillStyle": linearGradient.value()
        });

        painter.fillRect(0, 0, 700, 700);

    </script>
</body>

</html>
